// project home: cp3-cg.googlecode.com

#ifndef __MVP_H__
#define __MVP_H__
#include <Rtypes.h>
#include <vector>
using namespace std;

vector<Double_t> matrixvectorproduct(vector<Double_t> *A, vector<Int_t> *JA, vector<Int_t> *IA, vector<Double_t> *x,bool debug=false);

void Laplaceproduct(Int_t n, vector<Double_t>  *vecin, vector<Double_t>  *vecout);



Double_t skalarp(vector<Double_t> *x, vector<Double_t> *y);
Double_t skalarp_nop(vector<Double_t> *x, vector<Double_t> *y);


// the returned vector is x-y
void vectorsub(vector<Double_t> *x, vector<Double_t> *y, vector<Double_t> *vecout);
void vectorsub_nop(vector<Double_t> *x, vector<Double_t> *y, vector<Double_t> *vecout);

// the returned vector is x+y
void vectoradd(vector<Double_t> *x, vector<Double_t> *y, vector<Double_t> *vecout);
void vectoradd_nop(vector<Double_t> *x, vector<Double_t> *y, vector<Double_t> *vecout);


// the returned vector alpha*x
void VectorMultiS(vector<Double_t> *x, Double_t alpha, vector<Double_t> *vecout);
void VectorMultiS_nop(vector<Double_t> *x, Double_t alpha, vector<Double_t> *vecout);




#endif